package com.gko100.dao;

import java.util.List;

import com.gko100.model.Article;
import com.gko100.model.Disease;
import com.gko100.model.Language;
import com.gko100.model.Navigation;

public interface ArticleDao {
	
	Article findBackArtiByArtiId(Integer artiId);
	
	Article get(Integer artiId);
	
	void save(Article arti);
	
	void update(Article arti);
	
	void delete(Article arti);
	
	void delete(Integer artiId);
	
	List<Article> findArtiListByNav(Navigation nav);
	
	//前台---查找分类下所有文章---分页
	List<Article> findArtiListByNavListAndPage(List<Navigation> navList, int offset, int pageSize);
	
	List<Article> findBackArtiListByNavAndPage(List<Navigation> navList, int offset, int pageSize);
	
	List<Article> findArtiListByNavAndPage(Navigation nav, int offset, int pageSize);
	
	//查找当前文章的上一篇、下一篇
	List<Article> findArtiFront(Navigation nav, Integer artiId, int offset, int pageSize);
	List<Article> findArtiNext(Navigation nav, Integer artiId, int offset, int pageSize);
	
	List<Article> findArtiListByNavAndSortParam(Navigation nav, String sortParam);
	
	List<Article> findArtiListByDise(Disease dise);
	
	List<Article> findArtiListByDisAndNav(List<Disease> diseList, Navigation nav);
	
	List<Article> findArtiListByNav(Navigation nav,int pageNo, int pageSize);
	
	List<Article> findArtiListByNavIdAndArtiKey(Integer navId,String artiKey);
	
	Navigation findNavByArtiId(Integer artiId);
	
	Article findArtiByName(String name);
	
	int getArtiCount(Navigation nav);
	List<Disease> findDiseListByArticle(Article arti);
	/**
	 * 前台
	 */
	long find_backArtiTotalCountByNav(List<Navigation> navList);
	
	//前台---分类文章总数
	long find_artiTotalCountByNav(List<Navigation> navListv);
	
	List<Article> findArtiListByNavAndLang(Navigation nav, Language lang, String sortParam);
	
	//搜索
	long find_totalCountBySearchKey(String searchKey);
	List<Article> find_artiListBySearchKey(String searchKey);
	List<Article> find_artiListBySearchKeyAndPage(String searchKey, int offset, int pageSize);
	
	List<Article> findArtiListByDisListAndNote(List<Disease> diseList, String note);;
	List<Article> findArtiListByDisAndNote(Disease dise, String note);
	
}
